//
//  AdMoreRewardVideoAd.h
//  AdMoreSDKDemo
//
//  Created by Hayder on 2023/5/8.
//  视频激励广告

#import "AdMoreBaseAd.h"

NS_ASSUME_NONNULL_BEGIN
@interface AdMoreRewardInfo : NSObject

@property (nonatomic,assign) BOOL isVerify;

@property (nonatomic, copy) NSString *userId;
//rewardName
@property (nonatomic, copy) NSString *rewardName;

@property (nonatomic, assign) NSInteger rewardAmount;
/// 交易的唯一标识
@property (nonatomic, copy) NSString *transId;

/// adn定义的奖励id
@property (nonatomic, copy) NSString *rewardId;

//平台名
@property (nonatomic, copy) NSString *adnName;

//验证奖励发放的ecpm
@property (nonatomic, copy) NSString *ecpm;

/// 是否是通过GroMore的S2S的验证
@property (nonatomic, assign) BOOL verifyByServer;

//自定义信息
@property (nonatomic, copy) NSString *extra;

@end

@class AdMoreRewardVideoAd;
@protocol AdMoreRewardVideoAdDelegate <NSObject>

@optional
/**激励视频加载成功回调*/
- (void)rewardedVideoAdDidLoad:(AdMoreRewardVideoAd *)rewardedVideoAd slotId:(NSString *)slotId;
/**激励视频加载失败回调*/
- (void)rewardedVideoAd:(AdMoreRewardVideoAd *)rewardedVideoAd didFailWithError:(NSError *_Nullable)error;

/**激励视频开始播放回调 展示成功*/
- (void)rewardedVideoAdPlayStart:(AdMoreRewardVideoAd *)rewardedVideoAd;
/**激励视频播放结束回调*/
- (void)rewardedVideoAdPlayEnd:(AdMoreRewardVideoAd *)rewardedVideoAd;
/**激励视频播放出错*/
- (void)rewardedVideoAdPlayError:(AdMoreRewardVideoAd *)rewardedVideoAd error:(NSError *)error;


/**激励视频点击回调*/
- (void)rewardedVideoAdDidClick:(AdMoreRewardVideoAd *)rewardedVideoAd;
/**激励视频关闭回调*/
- (void)rewardedVideoAdDidClose:(AdMoreRewardVideoAd *)rewardedVideoAd;
/**激励视频跳过回调,不实现则跳过广告*/
- (void)rewardedVideoAdDidSkip:(AdMoreRewardVideoAd *)rewardedVideoAd;

/**奖励验证回调*/
- (void)rewardedVideoAdServerRewardDidSucceed:(AdMoreRewardVideoAd *)rewardedVideoAd rewardInfo:(AdMoreRewardInfo *)rewardInfo;
/**奖励验证失败回调**/
- (void)rewardedVideoAdServerRewardDidFail:(AdMoreRewardVideoAd *)rewardedVideoAd error:(nonnull NSError *)error;
@end



@interface AdMoreRewardVideoAd : AdMoreBaseAd

@property (nonatomic, strong, readonly) NSString *slotID;

@property (nonatomic, weak) id<AdMoreRewardVideoAdDelegate> delegate;

@property (nonatomic, strong) AdMoreRewardInfo *rewardInfo;
/**
 slotID: 广告位ID
 */
- (instancetype)initWithSlotID:(NSString *)slotID;

/**
 slotID: 广告位ID
 userId: 用户id
 rewardName: 奖励名称
 amount: 奖励数量
 extra: 自定义字段
 */
- (instancetype)initWithSlotID:(NSString *)slotID userId:(NSString *)userId rewardName:(NSString *)rewardName rewardAmount:(NSInteger)amount extra:(NSString *)extra;

- (void)loadAdData;

- (void)showFromRootViewController:(UIViewController *)showController;

@end

NS_ASSUME_NONNULL_END
